package cn.tedu._06springaop.aop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator {
    public int add(int x,int y){
        if(x>0){
            throw new IllegalArgumentException("参数不能大于0");
        }
        int result = x+y;
        System.out.println("方法内部："+result);
        return result;
    }
    public int sub(int x,int y){
        int result = x-y;
        System.out.println("方法内部："+result);
        return result;
    }
    public int mul(int x,int y){
        int result = x*y;
        System.out.println("方法内部："+result);
        return result;
    }
    public int div(int x,int y){
        int result = x/y;
        System.out.println("方法内部："+result);
        return result;
    }
}
